# -*- coding: utf-8 -*-
'''
Here all repositories are configured. 

Copy this file to repositories.py and set your configuration.
Created on 2010-03-28
'''
class Repositories: #pylint: disable-msg=R0903
    """
    Configure repositories here.
    """
    def __init__(self):
        pass
    # List of repositories 
    # Repositories might be either local or remote
    # Remote repositories of hg are in fact local, but they are 
    # pulled before check is done therefore they need a URL to pull them from.
    #
    # REPOSITORIE is a list of repository groups
    # Each group might be either single repository or it can be
    # list of several repositories. Common attributes (like flavor, login
    # password) can be specified at the level of the group as well as 
    # overridden/set in each of the repositories separately.
    #
    # Depending on repository type, single entry can still translate to 
    # several physical repositories. In case HG it is in case location 
    # is local directory and the directory contains many HG repositories
    # as subdirectories. In case of SVN "subdirectories" parameter might
    # be set to true and then single SVN repository is actually split to 
    # subdirectories exactly one level below. This is a commonly used SVN
    # pattern to host a number of repositories as subdirectory of 
    # single repository.
    #
    REPOSITORIES = [
      { 
         # Name of the repositories used in emails
         "title"     : "Internal repositories",
         # Note. For HG, location can be a super-directory
         # containing many HG repositories at any depth. 
         # Simply main dir and all tree 
         # are checked until all .hg subdirectories are found
         # if .hg is found, no further search below is done
         "location" : "file://C:\\CODEDIR\\",
         # Type of the repository - can be either hg or svn now
         "type"     : "hg",
         # Two flavours are currently supported for HG
         #   * cgiweb - if cgiweb is used to expose it externally
         #   * googlecode - if the repository is hosted in google code
         # Two flavours are currently supported for SVN
         #   * websvn - if websvn is used to expose it externally
         #   * googlecode - if the repository is hosted in google code
         "flavor"   : "cgiweb",
         "weburl"   : "https://dev.company.com/hg/",
      },
      { 
         "title"        : "Svn Repo",
         # If send_to_all_in_group is set to true, then mails are not sent 
         # individually but the result of all repository checks are sent to 
         # all contributors from all repositories. This is when we have a group 
         # of related repositories and we want to send
         # everything for whole group to contributors.
         "send_to_all_in_group" : True,
         # This is list of repositories specified one by one in the group
         "repos" : [ 
            {
               "title"           : "Repo",
               "weburl"         : "https://dev.company.com/websvn/",
               "location"       : "https://dev.company.com/repo",
               "type"           : "svn",
               # if subdirectories is true, then this repo is actually split
               # into smaller repositories - one for each subdirectory
               # (one level down from the top). In this case
               # name of the repository is equal to directory name
               "subdirectories" : True,
               "flavor"         : "websvn",
               "login"          : "login",
               "password"       : "password",
            },
            {
               "title"           : "Repo",
               "weburl"         : "https://dev.company.com/websvn2/",
               "location"       : "https://dev.company.com/repo2",
               "type"           : "svn",
               "flavor"         : "websvn",
               "login"          : "login",
               "password"       : "password",
            },
         ],
      },
      { 
         "title"        : "External repositories",
         # Flavor, login and password are specified at the group 
         # level - reused for all repositories below as needed.
         "flavor"         : "googlecode",
         "login"          : "login",
         "password"       : "password",
         "repos" : [ 
            {
               "title"        : "Repo1",
               "weburl"      : "https://external.com/hg/webview/",
               "location"    : "https://repo1.googlecode.com/svn",
               "type"        : "svn",
            },
            {
               "title"        : "Repo2",
               "location"    : "file://C:\\EXTERNALCODEDIR\\repo2",
               # This repository is refreshed (pulled) every time we start
               # the heartbeat. Note that we need to have a clone
               # of the repository already in the location specified
               "pullurl"     : "https://repo2.googlecode.com/hg/",
               "weburl"      : "http://code.google.com/p/repo2/",
               "type"        : "hg",
            },
         ],
      },
    ]                 
